<html>
<head>
<title>POJava HOWTO: Tm</title>
<LINK REL="stylesheet" HREF="/style/pojava.css" TYPE="text/css" MEDIA=screen />
</head>
<body>
<h1>HOWTO use Tm</h1>
<p>The Tm class breaks a date and time down to individual components, of year, month, day,
hour, minute, second, nanosecond, and weekday specific to a TimeZone.</p>
<p>Tm is similar in purpose to the struct tm in C, but provides its own methods and treats
months as numbered by 1 through 12 instead of zero-based.  You would use Tm if you want to
either decompose a time down to individual units to perform calculations, or to use calculated
time components to build up to a date and time.</p>

<h3>Usage Examples</h3>
<pre>
// Create a quick millisecond time, knowing year, month, and day.
long timeInMillis=Tm.calcTime(2014, 02, 28);

// Extract various date parts, given a millisecond timestamp
Tm dateParts=new Tm(timeInMillis, TimeZone.getTimeZone("America/Chicago"));
int year=dateParts.getYear();
int hour=dateParts.getHour();
</pre>

</body>
</html>
